import request from '@/utils/request'

// 微信支付
export function pay(data) {
	return request({
		url: '/order/order/pay',
		method: 'post',
		data: data
	})
}

// 订单列表页-继续支付
export function goOnPay(data) {
	return request({
		url: '/order/order/goOnPay',
		method: 'post',
		data: data
	})
}

// 查询支付结果
export function queryPayResult(orderId) {
	return request({
		url: '/order/order/pay/query/' + orderId,
		method: 'get'
	})
}

// 查询订单主表列表
export function listOrder(query) {
	return request({
		url: '/order/order/list',
		method: 'get',
		params: query
	})
}

// 查询订单主表详细
export function getOrder(id) {
	return request({
		url: '/order/order/' + id,
		method: 'get'
	})
}

// 新增订单主表
export function addOrder(data) {
	return request({
		url: '/order/order',
		method: 'post',
		data: data
	})
}

// 修改订单主表
export function updateOrder(data) {
	return request({
		url: '/order/order',
		method: 'put',
		data: data
	})
}

// 删除订单主表
export function delOrder(id) {
	return request({
		url: '/order/order/' + id,
		method: 'delete'
	})
}

// 取消订单
export function cancelOrder(orderId) {
	return request({
		url: '/order/order/cancelOrder/' + orderId,
		method: 'get'
	})
}

// 申请退款
export function applyRefund(orderId) {
	return request({
		url: '/order/order/refund/apply/' + orderId,
		method: 'get'
	})
}